﻿
var iNvoiceApp = angular.module('iNvoiceApp', ['ui.router', 'dynform', 'ui.bootstrap', 'ngAnimate', 'jqwidgets', 'angularFileUpload', 'base64', 'ngTable']);

    // Factories
    iNvoiceApp.factory('countryFactory', countryFactory);
    iNvoiceApp.factory('formElementsFactory', formElementsFactory);
    iNvoiceApp.factory('fileReaderFactory', fileReaderFactory);

    // Controllers
    //iNvoiceApp.controller('iconLogoController', iconLogoController);
   iNvoiceApp.controller('modalIconsController', modalIconsController);
    iNvoiceApp.controller('invoiceTemplateCreator', invoiceTemplateCreator);
    iNvoiceApp.controller('formPersonalInfoController', formPersonalInfoController);
    iNvoiceApp.controller('formCreatorController', formCreatorController);
    iNvoiceApp.controller('AccordionDemoCtrl', AccordionDemoCtrl);
    iNvoiceApp.controller('TypeaheadCtrl', TypeaheadCtrl);
    iNvoiceApp.controller('logoDesignerController', logoDesignerController);
    iNvoiceApp.controller('iconLogoController', iconLogoController);
    iNvoiceApp.controller('tablePurchasedItemController', tablePurchasedItemController);
    iNvoiceApp.controller('tableHeadersDefinitionCtrl', tableHeadersDefinitionCtrl);
    iNvoiceApp.controller('companyInfoController', companyInfoController);

    // Directives 
    iNvoiceApp.directive('xvFormCreator',xvFormCreator);

// Routing configuration with ui-router from angular
    var configFunction = function ($stateProvider) {

        $stateProvider
          .state('stateOne', {
                url: '/stateOne',
                views: {
                    "containerOne": {
                        templateUrl: '/routes/one'
                    }
                }
            })
            .state('stateTwo', {
                url: '/stateTwo',
                views: {"containerOne": {
                        templateUrl: '/routes/Two'
                    }
                }
            }).state('stateThree', {
                url: '/stateThree',
                views: {
                    "containerOne": {
                        templateUrl: '/routes/Three'
                    }
                }
            }).state('stateFour', {
                url: '/stateFour',
                views: {
                    "containerOne": {
                        templateUrl: '/routes/Four'
                    }
                }
            });;
    };

    configFunction.$inject = ['$stateProvider'];

    iNvoiceApp.config(configFunction);
 